home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / CarbonizedMenus / headers / AutoPort.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-06-24  |  698 b   |  29 lines  |  [TEXT/CWIE]

  1. /****************************************************************************************
  2.     AutoPort.h
  3.     
  4.     Copyright © 1999 Red Shed Software. All rights reserved.
  5.     by Jonathan 'Wolf' Rentzsch (jon@redshed.net)
  6.     
  7.     Commenter    Date                Comment
  8.     ---------    -----------------    -----------------------------------------------------
  9.     wolf        Thu, Jun 24, 1999    Created.
  10.     
  11.     ************************************************************************************/
  12.  
  13. #ifndef        _AutoPort_
  14. #define        _AutoPort_
  15.  
  16. class    AutoPort    {
  17.     public:
  18.         AutoPort(
  19.             WindowPtr    newPort )
  20.         {    GetPort( &oldPort_ );
  21.             SetPort( newPort ); }
  22.         
  23.         ~AutoPort()
  24.         {    SetPort( oldPort_ ); }
  25.     private:
  26.         WindowPtr    oldPort_;
  27. };
  28.  
  29. #endif    //    _AutoPort_